package com.stylefeng.guns;

import javax.imageio.ImageIO;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;

/**
 * Created by Admin on 2017/9/27.
 */
public class T {
    public static void main(String []args) throws IOException {
        File file = new File("D:\\FanngHongYang\\java\\guns\\guns\\guns-admin\\src\\test\\java\\my.jpg");
        BufferedImage read = ImageIO.read(file);
        int width = read.getWidth();
        int height = read.getHeight();
        for(int i=1;width>i;i++){
            for(int j=1;height>j;j++){
                int rgb = read.getRGB(i, j);
                int red=rgb>>16&255;
                int green=rgb>>8&255;
                int blue=rgb&255;
                red=red*15/10;
                red=red>255?255:red;
                green=green*15/10;
                green=green>255?255:green;
                blue=blue*15/10;
                blue=blue>255?255:blue;
                int xing=rgb>>>24<<24|red<<16|green<<8|blue;
                read.setRGB(i,j,xing);
            }

        }
        ImageIO.write(read,"jpg",new File("you.jpg"));
    }
}
